import {onMounted, ref,computed} from "vue";

export default function (){
    let sum=ref(0)
    let bigSum=computed(()=>{
        return sum.value*10
    })
//axios发起请求

function  changeSum(){
    sum.value+=1;
}
onMounted(()=>{
    changeSum()//挂载的时候直接调用+1
})
//以对象形式为外部提供数据
    return{sum,changeSum,bigSum}
}